Enhancement Toolset
===================

These tools are designed to automate key tasks involved in data creation and revision that improve the accuracy, consistency, and overall integrity of the data.

Add Topology
------------

This tool verifies that spatial data within a Geodatabase follow the rules and relationships required by the Standard by adding a topology dataset to the :term:`required feature dataset`. It checks the geometric relationships among geographic features—such as roads, boundaries, and address points—to ensure that the data are clean, accurate, and logically consistent.

.. seealso::

   :ref:`schema-topology-rules` and :ref:`schema-topology-exceptions`

Purpose
+++++++

By running the Topology Tool, users can:

- Validate that all spatial data conform to NG911 topology standards.
- Detect and correct spatial errors before submission.
- Ensure statewide consistency and data integrity across all NG911 datasets.

Calculate/Convert/Fix Field(s)
------------------------------

The **Field Calculation and Conversion Tool** automates the process of calculating, converting, and cleaning fields in the **Standard NG911 feature classes**.
It ensures that address points, road centerlines, and related datasets comply with both **Next Generation (Next-Gen)** and, as applicable, **Legacy** data standards.

Usage
+++++

1. Select the :term:`NG911 geodatabase`.
2. Choose the desired analysis type (e.g., calculate, convert, or fix fields).
3. Set any required and optional parameters.
4. Run the tool to perform all necessary calculations or corrections automatically.

Available Analyses
++++++++++++++++++

.. _ccf-fullname:

Calculate ``FullName`` and/or ``LgcyFulSt``
*******************************************

Calculates the :ng911field:`fullname` (if :bdg-contrast-line:`NEXT-GEN` is selected) and :ng911field:`lgcyfulst` (if :bdg-contrast-line:`LEGACY` is selected) fields for :ng911fc:`address_point` and/or :ng911fc:`road_centerline`.

The Next-Gen street fields are used to compute :ng911field:`fullname`, and the Legacy street fields are used to compute :ng911field:`lgcyfulst`.

.. tip::

   If only one set of street fields are populated (i.e., either Next-Gen or Legacy street fields), consider first running ccf-convert-type_ and/or ccf-convert-direction_.

.. _ccf-fulladdr:

Calculate ``FullAddr`` and/or ``LgcyFulAdd``
********************************************

Calculates the :ng911field:`fulladdr` (if :bdg-contrast-line:`NEXT-GEN` is selected) and :ng911field:`lgcyfuladd` (if :bdg-contrast-line:`LEGACY` is selected) fields for :ng911fc:`address_point`.

The Next-Gen street/address fields are used to compute :ng911field:`fulladdr`, and the Legacy street/address fields are used to compute :ng911field:`lgcyfuladd`.

.. tip::

   If only one set of street fields are populated (i.e., either Next-Gen or Legacy street fields), consider first running ccf-convert-type_ and/or ccf-convert-direction_.

.. _ccf-calculate-parity:

Calculate ``Parity_L`` and ``Parity_R``
***************************************

Uses the address range fields to compute :ng911field:`parity_l` and :ng911field:`parity_r` in :ng911fc:`road_centerline`.

.. _ccf-calculate-null-n:

Calculate Null Values to ``N``
******************************

Automatically replaces null values in fields with the :ng911domain:`YESNO` domain with ``N``.

.. _ccf-rclmatch-rclside:

Calculate ``RCLMatch`` and ``RCLSide``
**************************************

Links :ng911fc:`address_point` features to their corresponding :ng911fc:`road_centerline` features by performing the following operations:

- Creating dataframes for both feature classes
- Matching concatenated street field strings
- Comparing address numbers, parity, and MSAG community fields
- Assigning :ng911field:`nguid_rdcl` to matching address point's :ng911field:`rclmatch`

If multiple matches occur, the tool labels them as ``TIES`` and returns all related IDs as a pipe-separated list. If there is no match, the attribute is set to ``NO MATCH``.


Calculate ``MSAGComm``
**********************

In :ng911fc:`address_point`, sets null :ng911field:`msagcomm` attributes to the value of :ng911field:`city`, or, if it is also null, to the value of :ng911field:`county`.

It does the same for :ng911fc:`road_centerline`, but with the left and right equivalent fields, as well as setting :ng911field:`geomsag_l` and :ng911field:`geomsag_r` to either ``N`` if the corresponding MSAG community field is null or ``Y`` if it is not null.

.. _ccf-convert-type:

Convert ``Type`` (``Legacy`` or ``NEXT GEN``)
*********************************************

In :ng911fc:`address_point` and :ng911fc:`road_centerline`, uses the values of :ng911field:`pretype` and :ng911field:`streettype` to compute :ng911field:`lgcypretyp` and :ng911field:`lgcytype`, respectively, or vice-versa.

.. _ccf-convert-direction:

Convert ``Direction`` (``Legacy`` or ``NEXT GEN``)
**************************************************

In :ng911fc:`address_point` and :ng911fc:`road_centerline`, uses the values of :ng911field:`predir` and :ng911field:`sufdir` to compute :ng911field:`lgcypredir` and :ng911field:`lgcysufdir`, respectively, or vice-versa.

.. _ccf-fix-spaces:

Fix Leading/Trailing Spaces
***************************

Removes unnecessary spaces from the beginning and end of text attributes.

.. _ccf-fix-domain-case:

Fix Domain Case
***************

Adjusts capitalization of attributes to match domain values. For example, if a :ng911field:`predir` attribute is ``North``, this analysis would change the letter case to ``NORTH``, as in :ng911domain:`DIRECTION`.

.. _ccf-fix-level:

Fix Level Fields
****************

Converts :ng911field:`fromlevel` and :ng911field:`tolevel` fields from numeric to text format for consistency in :ng911fc:`road_centerline` data.
